package com.example.shardingmultdatasource;

import com.example.shardingmultdatasource.config.DBConfig;
import com.example.shardingmultdatasource.config.MultipleDataSourceConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

//排除DataSource自动配置类,否则会默认自动配置,不会使用我们自定义的DataSource,并且启动报错
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableDiscoveryClient
@EnableConfigurationProperties({DBConfig.class})
public class ShardingmultdatasourceApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShardingmultdatasourceApplication.class, args);
    }

}

